package com.lvmama.pangolin.xc.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.github.pagehelper.PageHelper;
import com.lvmama.pangolin.entity.xc.XCTicketProductItem;
import com.lvmama.pangolin.entity.xc.XCTicket_Commodity;
import com.lvmama.pangolin.mybatis.mapper.xc.XCTicketProductItemsMapper;
import com.lvmama.pangolin.xc.service.XCTicketProductItemsService;
@Transactional
@Service
public class XCTicketProductItemsServiceImpl implements XCTicketProductItemsService{
	/**  
	* @Title：TCProductItemsServiceImpl.java
	* @Author:zhoutianqi
	* @Description:
	* @Date：2017年3月6日下午4:27:26  
	*/
	@Autowired
	private XCTicketProductItemsMapper xcProductItemsMapper;
	public int insert(XCTicket_Commodity item)throws Exception{
		return xcProductItemsMapper.insert(item);
	}
	public XCTicketProductItem selectById(String id)throws Exception{
		return xcProductItemsMapper.selectById(id);
	}
	public int update(XCTicket_Commodity item)throws Exception{
		return xcProductItemsMapper.update(item);
	}
	@Override
	public List<XCTicketProductItem> selectByLimitNum(int page, int pageSize) {
		PageHelper.startPage(page, pageSize,"product_id asc"); // 核心分页代码
		List<XCTicketProductItem> list = xcProductItemsMapper.selectByLimitNum();
		return list;
	}
	@Override
	public int updateByItem(XCTicketProductItem item){
		return xcProductItemsMapper.updateByItem(item);
	}
}
